package annotation.demo;

import java.io.File;
import java.io.FileFilter;
import java.util.LinkedList;
import java.util.List;

public class texsst {
	public static void main(String[] args) {
//		 List<File> list=new LinkedList<File>();
//		 getOneDir("src/annotation",list,"action");
//		 for (File file : list) {
//			System.out.println("--------------"+file.getName());
//		}
		String str="\\Work\\apache-tomcat-8.0.33\\RegisterAction";
		System.out.println(str.replaceAll("\\\\", "."));
		
	}
	 
	private static void getOneDir(String fileName,List<File> list,String suffix){
		File file=new File(fileName);
		if(!file.isDirectory()){
			return;
		}
		File[] files=file.listFiles(new FileFilter() {
			@Override
			public boolean accept(File file) {
				return (file.isDirectory());
			}
		});
		if(files==null||files.length==0){
			return;
		}
		for (File file2 : files) {
			list.add(file2);
			if(file2.getName().equals(suffix)){
				list.remove(list.size()-1);
				list.add(0, file2);
				continue;
			}
			System.out.println(fileName+"/"+file2.getName());
			getOneDir(fileName+"/"+file2.getName(),list,suffix);
			list.remove(list.size()-1);
		}
	}
}
